function truemsg(layer,msg,callback){
    layer.msg(msg, {
        icon: 1,
        time: 2000
    }, function() {
        if (typeof callback === 'function') {
            callback();
        }
        
    });
    
}

function falsemsg(layer,msg,callback){
    layer.msg(msg, {
        icon: 2,
        time: 3000
    }, function() {
        if (typeof callback === 'function') {
            callback();
        }
    });
}

function layeralert(layer, msg, callback) {
    layer.alert(msg, { 
        yes: function(index, layero){
            // 调用回调函数（如果提供了）
            if (typeof callback === 'function') {
                callback();
            }
            // 关闭当前的提示框
            layer.close(index);
        }
    });
}

function tc(url,title = "标题"){
    layer.open({
		type: 2,
		maxmin: true,
		title: title,
		shade: 0.1,
		area: screen(),
		content: url
	});
}
			    
function screen() {
	if (typeof width !== 'number' || width === 0) {
		width = $(window).width() * 0.5;
	}
	if (typeof height !== 'number' || height === 0) {
		height = $(window).height() * 0.5;
	}
	return [width + 'px', height + 'px'];
}

function closeEditWindow() {
    layer.closeAll('iframe');
}